<?php

namespace App\Filament\Pages;

use App\Settings\Borrow;
use Filament\Forms;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Pages\SettingsPage;

class ManageFooter extends SettingsPage
{
    protected static ?string $navigationIcon = 'heroicon-o-cog-6-tooth';

    protected static string $settings = Borrow::class;

    protected static ?string $navigationLabel = '系统设置';

    protected static ?string $title = '系统设置';

    public function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\Section::make('基本设置')
                    ->columns(2)
                    ->schema([
                        TextInput::make('site_name')
                            ->label('系统名称')
                            ->required(),

                        Forms\Components\TextInput::make('borrow_days')
                            ->numeric()
                            ->label('借阅天数')
                            ->default(7),
                        Forms\Components\TextInput::make('borrow_overdue_price')
                            ->numeric()
                            ->inputMode('decimal')
                            ->label('逾期罚金')
                            ->prefix('￥')
                            ->suffix('天')
                            ->default(10),
                        Forms\Components\TextInput::make('borrow_extend')
                            ->numeric()
                            ->label('续借天数')
                            ->default(7),
                        Forms\Components\Toggle::make('site_active')
                            ->label('系统状态')
                            ->default(true),
                    ]),
                // ...

            ]);
    }
}
